

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>llvm-nm - list LLVM bitcode and object file’s symbol table &mdash; LLVM 3.2 documentation</title>
    
    <link rel="stylesheet" href="../_static/llvm-theme.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '3.2',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="top" title="LLVM 3.2 documentation" href="../index.html" />
    <link rel="up" title="LLVM Command Guide" href="index.html" />
    <link rel="next" title="llvm-prof - print execution profile of LLVM program" href="llvm-prof.html" />
    <link rel="prev" title="llvm-ranlib - Generate index for LLVM archive" href="llvm-ranlib.html" />
<style type="text/css">
  table.right { float: right; margin-left: 20px; }
  table.right td { border: 1px solid #ccc; }
</style>

  </head>
  <body>
<div class="logo">
  <a href="../index.html">
    <img src="../_static/logo.png"
         alt="LLVM Logo" width="250" height="88"/></a>
</div>

    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="llvm-prof.html" title="llvm-prof - print execution profile of LLVM program"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="llvm-ranlib.html" title="llvm-ranlib - Generate index for LLVM archive"
             accesskey="P">previous</a> |</li>
  <li><a href="http://llvm.org/">LLVM Home</a>&nbsp;|&nbsp;</li>
  <li><a href="../index.html">Documentation</a>&raquo;</li>

          <li><a href="../userguides.html" >User Guides</a> &raquo;</li>
          <li><a href="index.html" accesskey="U">LLVM Command Guide</a> &raquo;</li> 
      </ul>
    </div>

      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">llvm-nm - list LLVM bitcode and object file&#8217;s symbol table</a><ul>
<li><a class="reference internal" href="#synopsis">SYNOPSIS</a></li>
<li><a class="reference internal" href="#description">DESCRIPTION</a></li>
<li><a class="reference internal" href="#options">OPTIONS</a></li>
<li><a class="reference internal" href="#bugs">BUGS</a></li>
<li><a class="reference internal" href="#exit-status">EXIT STATUS</a></li>
<li><a class="reference internal" href="#see-also">SEE ALSO</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="llvm-ranlib.html"
                        title="previous chapter">llvm-ranlib - Generate index for LLVM archive</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="llvm-prof.html"
                        title="next chapter">llvm-prof - print execution profile of LLVM program</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../_sources/CommandGuide/llvm-nm.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="llvm-nm-list-llvm-bitcode-and-object-file-s-symbol-table">
<h1>llvm-nm - list LLVM bitcode and object file&#8217;s symbol table<a class="headerlink" href="#llvm-nm-list-llvm-bitcode-and-object-file-s-symbol-table" title="Permalink to this headline">¶</a></h1>
<div class="section" id="synopsis">
<h2>SYNOPSIS<a class="headerlink" href="#synopsis" title="Permalink to this headline">¶</a></h2>
<p><strong class="program">llvm-nm</strong> [<em>options</em>] [<em>filenames...</em>]</p>
</div>
<div class="section" id="description">
<h2>DESCRIPTION<a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2>
<p>The <strong class="program">llvm-nm</strong> utility lists the names of symbols from the LLVM bitcode
files, object files, or <strong class="program">ar</strong> archives containing them, named on the
command line. Each symbol is listed along with some simple information about its
provenance. If no file name is specified, or <em>-</em> is used as a file name,
<strong class="program">llvm-nm</strong> will process a file on its standard input stream.</p>
<p><strong class="program">llvm-nm</strong>&#8216;s default output format is the traditional BSD <strong class="program">nm</strong>
output format. Each such output record consists of an (optional) 8-digit
hexadecimal address, followed by a type code character, followed by a name, for
each symbol. One record is printed per line; fields are separated by spaces.
When the address is omitted, it is replaced by 8 spaces.</p>
<p>Type code characters currently supported, and their meanings, are as follows:</p>
<p>U</p>
<blockquote>
<div>Named object is referenced but undefined in this bitcode file</div></blockquote>
<p>C</p>
<blockquote>
<div>Common (multiple definitions link together into one def)</div></blockquote>
<p>W</p>
<blockquote>
<div>Weak reference (multiple definitions link together into zero or one definitions)</div></blockquote>
<p>t</p>
<blockquote>
<div>Local function (text) object</div></blockquote>
<p>T</p>
<blockquote>
<div>Global function (text) object</div></blockquote>
<p>d</p>
<blockquote>
<div>Local data object</div></blockquote>
<p>D</p>
<blockquote>
<div>Global data object</div></blockquote>
<p>?</p>
<blockquote>
<div>Something unrecognizable</div></blockquote>
<p>Because LLVM bitcode files typically contain objects that are not considered to
have addresses until they are linked into an executable image or dynamically
compiled &#8220;just-in-time&#8221;, <strong class="program">llvm-nm</strong> does not print an address for any
symbol in a LLVM bitcode file, even symbols which are defined in the bitcode
file.</p>
</div>
<div class="section" id="options">
<h2>OPTIONS<a class="headerlink" href="#options" title="Permalink to this headline">¶</a></h2>
<dl class="option">
<dt id="cmdoption-llvm-nm-B">
<tt class="descname">-B</tt><tt class="descclassname">    (default)</tt><a class="headerlink" href="#cmdoption-llvm-nm-B" title="Permalink to this definition">¶</a></dt>
<dd><p>Use BSD output format. Alias for <em class="xref std std-option">--format=bsd</em>.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-llvm-nm-P">
<tt class="descname">-P</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-llvm-nm-P" title="Permalink to this definition">¶</a></dt>
<dd><p>Use POSIX.2 output format. Alias for <em class="xref std std-option">--format=posix</em>.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-llvm-nm--debug-syms">
<tt class="descname">--debug-syms</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">-a</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-llvm-nm--debug-syms" title="Permalink to this definition">¶</a></dt>
<dd><p>Show all symbols, even debugger only.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-llvm-nm--defined-only">
<tt class="descname">--defined-only</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-llvm-nm--defined-only" title="Permalink to this definition">¶</a></dt>
<dd><p>Print only symbols defined in this file (as opposed to
symbols which may be referenced by objects in this file, but not
defined in this file.)</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-llvm-nm--dynamic">
<tt class="descname">--dynamic</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">-D</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-llvm-nm--dynamic" title="Permalink to this definition">¶</a></dt>
<dd><p>Display dynamic symbols instead of normal symbols.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-llvm-nm--extern-only">
<tt class="descname">--extern-only</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">-g</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-llvm-nm--extern-only" title="Permalink to this definition">¶</a></dt>
<dd><p>Print only symbols whose definitions are external; that is, accessible
from other files.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-llvm-nm--format">
<tt class="descname">--format</tt><tt class="descclassname">=format</tt><tt class="descclassname">, </tt><tt class="descname">-f</tt><tt class="descclassname"> format</tt><a class="headerlink" href="#cmdoption-llvm-nm--format" title="Permalink to this definition">¶</a></dt>
<dd><p>Select an output format; <em>format</em> may be <em>sysv</em>, <em>posix</em>, or <em>bsd</em>. The default
is <em>bsd</em>.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-llvm-nm-help">
<tt class="descname">-help</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-llvm-nm-help" title="Permalink to this definition">¶</a></dt>
<dd><p>Print a summary of command-line options and their meanings.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-llvm-nm--no-sort">
<tt class="descname">--no-sort</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">-p</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-llvm-nm--no-sort" title="Permalink to this definition">¶</a></dt>
<dd><p>Shows symbols in order encountered.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-llvm-nm--numeric-sort">
<tt class="descname">--numeric-sort</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">-n</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">-v</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-llvm-nm--numeric-sort" title="Permalink to this definition">¶</a></dt>
<dd><p>Sort symbols by address.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-llvm-nm--print-file-name">
<tt class="descname">--print-file-name</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">-A</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">-o</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-llvm-nm--print-file-name" title="Permalink to this definition">¶</a></dt>
<dd><p>Precede each symbol with the file it came from.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-llvm-nm--print-size">
<tt class="descname">--print-size</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">-S</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-llvm-nm--print-size" title="Permalink to this definition">¶</a></dt>
<dd><p>Show symbol size instead of address.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-llvm-nm--size-sort">
<tt class="descname">--size-sort</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-llvm-nm--size-sort" title="Permalink to this definition">¶</a></dt>
<dd><p>Sort symbols by size.</p>
</dd></dl>

<dl class="option">
<dt id="cmdoption-llvm-nm--undefined-only">
<tt class="descname">--undefined-only</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">-u</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-llvm-nm--undefined-only" title="Permalink to this definition">¶</a></dt>
<dd><p>Print only symbols referenced but not defined in this file.</p>
</dd></dl>

</div>
<div class="section" id="bugs">
<h2>BUGS<a class="headerlink" href="#bugs" title="Permalink to this headline">¶</a></h2>
<blockquote>
<div><ul class="simple">
<li><strong class="program">llvm-nm</strong> cannot demangle C++ mangled names, like GNU <strong class="program">nm</strong>
can.</li>
<li><strong class="program">llvm-nm</strong> does not support the full set of arguments that GNU
<strong class="program">nm</strong> does.</li>
</ul>
</div></blockquote>
</div>
<div class="section" id="exit-status">
<h2>EXIT STATUS<a class="headerlink" href="#exit-status" title="Permalink to this headline">¶</a></h2>
<p><strong class="program">llvm-nm</strong> exits with an exit code of zero.</p>
</div>
<div class="section" id="see-also">
<h2>SEE ALSO<a class="headerlink" href="#see-also" title="Permalink to this headline">¶</a></h2>
<p>llvm-dis|llvm-dis, ar(1), nm(1)</p>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="llvm-prof.html" title="llvm-prof - print execution profile of LLVM program"
             >next</a> |</li>
        <li class="right" >
          <a href="llvm-ranlib.html" title="llvm-ranlib - Generate index for LLVM archive"
             >previous</a> |</li>
  <li><a href="http://llvm.org/">LLVM Home</a>&nbsp;|&nbsp;</li>
  <li><a href="../index.html">Documentation</a>&raquo;</li>

          <li><a href="../userguides.html" >User Guides</a> &raquo;</li>
          <li><a href="index.html" >LLVM Command Guide</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2012, LLVM Project.
      Last updated on 2012-12-21.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
    </div>
  </body>
</html>